﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BSCMFF.Core.DataAccessLayer
{
    /// <summary>
    /// Expands Training class (generated from database).
    /// </summary>
    /// <remarks></remarks>
    public partial class Training
    {
        /// <summary>
        /// Gets the status.
        /// </summary>
        /// <remarks></remarks>
        public string Status
        {
            get
            {
                if (this.DateStart != null && DateTime.Today < this.DateStart)
                {
                    return "Planned";
                }

                if (this.DateStart != null && DateTime.Today >= this.DateStart)
                {
                    if (this.DateEnd != null && DateTime.Today > this.DateEnd)
                    {
                        return "Completed";
                    }
                    else
                    {
                        return "In Progress";
                    }
                }
                return "Unknown";
            }
        }
    }
}
